<?php defined('_VALID_MOS') or die('Direct Access to this location is not allowed.'); ?>

<script language="javascript" type="text/javascript">
    function submitbutton(pressbutton) {
        var form = document.adminForm;
        if (pressbutton == 'cancel') {
            submitform( pressbutton );
            return;
        }
		
        if (form.name.value == ""){
            alert( "<?php echo 'Must have a name'; ?>." );
        }
        else {
            submitform( pressbutton );
        }
    }
</script>

<table cellpadding="4" cellspacing="0" border="0" width="100%">
    <tr>
        <td width="100%">
            <span class="sectionname">
                <?php echo $this->project->getName(); ?> - <?php echo $this->team->getName(); ?> - <?php echo $this->player->getName(); ?>
            </span>
        </td>
    </tr>
</table>

<form action="index2.php" method="post" name="adminForm" id="adminForm" enctype="multipart/form-data">

    <?php
        $ptabs = new mosTabs(0);
        $ptabs->startPane("com_leagueman");
        $ptabs->startTab("General", "General-page");
    ?>

    <table class="adminform">
        <tr>
            <td width="60%" valign="top">
                <table width="100%">
                    <tr>
                        <td width="20%" align="right"><b><?php echo 'Name'; ?>:</b></td>
                        <td width="80%">
                            <a href="index2.php?option=com_leagueman&act=players&task=edit&id=<?php echo $this->player->getID(); ?>"><?php echo $this->player->getName(); ?></a>
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right"><b><?php echo 'Position'; ?>:</b></td>
                        <td width="80%">
                            <?php echo mosHTML::selectList($this->positions, 'playermap_position', 'class="text_area" size="1"', 'value', 'text', $this->row->getPosition()); ?>
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right"><b><?php echo 'Number'; ?>:</b></td>
                        <td width="80%">
                            <input type="text" name="position_number" size="5" value="<?php echo $this->row->getNumber(); ?>" class="text_area" style="text-align: center" />
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right"><b><?php echo 'Matches'; ?>:</b></td>
                        <td width="80%">
                            <input type="text" name="cnt_matches" size="5" value="<?php echo $this->row->getCount("cnt_matches"); ?>" class="text_area" style="text-align: center" />
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right"><b><?php echo 'In'; ?>:</b></td>
                        <td width="80%">
                            <input type="text" name="cnt_in" size="5" value="<?php echo $this->row->getCount("cnt_in"); ?>" class="text_area" style="text-align: center" />
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right"><b><?php echo 'Out'; ?>:</b></td>
                        <td width="80%">
                            <input type="text" name="cnt_out" size="5" value="<?php echo $this->row->getCount("cnt_out"); ?>" class="text_area" style="text-align: center" />
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right"><b><?php echo 'Goals'; ?>:</b></td>
                        <td width="80%">
                            <input type="text" name="cnt_goals" size="5" value="<?php echo $this->row->getCount("cnt_goals"); ?>" class="text_area" style="text-align: center" />
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right"><b><?php echo 'Own Goals'; ?>:</b></td>
                        <td width="80%">
                            <input type="text" name="cnt_own_goals" size="5" value="<?php echo $this->row->getCount("cnt_own_goals"); ?>" class="text_area" style="text-align: center" />
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right"><b><?php echo 'Assists'; ?>:</b></td>
                        <td width="80%">
                            <input type="text" name="cnt_assists" size="5" value="<?php echo $this->row->getCount("cnt_assists"); ?>" class="text_area" style="text-align: center" />
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right"><b><?php echo 'Yellow Cards'; ?>:</b></td>
                        <td width="80%">
                            <input type="text" name="cnt_yellow" size="5" value="<?php echo $this->row->getCount("cnt_yellow"); ?>" class="text_area" style="text-align: center" />
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right"><b><?php echo 'Yellow/Red Cards'; ?>:</b></td>
                        <td width="80%">
                            <input type="text" name="cnt_yellow_red" size="5" value="<?php echo $this->row->getCount("cnt_yellow_red"); ?>" class="text_area" style="text-align: center" />
                        </td>
                    </tr>
                    <tr>
                        <td width="20%" align="right"><b><?php echo 'Red Cards'; ?>:</b></td>
                        <td width="80%">
                            <input type="text" name="cnt_red" size="5" value="<?php echo $this->row->getCount("cnt_red"); ?>" class="text_area" style="text-align: center" />
                        </td>
                    </tr>
                </table>
            </td>
            <td width="40%" valign="top">
                <div align="center">
                    <?php $this->plugin("thumb", "players", $this->row->getImage(), 200, 200); ?>
                </div>
            </td>
        </tr>
    </table>

    <?php
        $ptabs->endTab();
        $ptabs->startTab("Upload", "Upload-page");
    ?>

    <table cellpadding="4" cellspacing="1" border="0" width="100%" class="adminform">
        <tr>
            <td width="20%" align="right"><b><?php echo 'Choose an Image'; ?>:</b></td>
            <td width="80%">
                <input type="file" name="upload" size="40" class="text_area" />
            </td>
        </tr>
    </table>
    
    <?php
        $ptabs->endTab();
        $ptabs->endPane();
    ?>

    <input type="hidden" name="playermap_id" value="<?php echo $this->row->getID(); ?>" />
    <input type="hidden" name="team_id" value="<?php echo $this->team->getID(); ?>" />
    <input type="hidden" name="player_id" value="<?php echo $this->player->getID(); ?>" />
    <input type="hidden" name="project_id" value="<?php echo $this->project->getID(); ?>" />
    <input type="hidden" name="option" value="com_leagueman" />
    <input type="hidden" name="act" value="playermap" />
    <input type="hidden" name="task" value="" />
</form>